<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		
		<link rel="stylesheet" href="static/css/datepicker.css" /><!-- 日期框 -->
		<link rel="stylesheet" href="static/css/bootstrap-datetimepicker.css" /><!-- 日期框 -->
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		
<script type="text/javascript">
//保存
	function save(){
	if($("#receive_status").val()==""){
		$("#receive_status").tips({
			side:3,
            msg:'请输入',
            bg:'#AE81FF',
            time:2
        });
		$("#receive_status").focus();
		return false;
	}
	
	if($("#receive_status").val()=="1"&&$("#revision_begintime").val()==""){
		$("#revision_begintime").tips({
			side:3,
            msg:'请输入',
            bg:'#AE81FF',
            time:2
        });
		$("#revision_begintime").focus();
		return false;
	}
	
	if($("#receive_status").val()=="2"&&$("#revision_endtime").val()==""){
		$("#revision_endtime").tips({
			side:3,
            msg:'请输入',
            bg:'#AE81FF',
            time:2
        });
		$("#revision_endtime").focus();
		return false;
	}
		$("#Form").submit();
		$("#zhongxin").hide();
		$("#zhongxin2").show();
	}
	
</script>
	</head>
<body>
	<form action="lawreceive/${msg }.do" name="Form" id="Form" method="post">
	<input type="hidden" name="receive_id" id="receive_id" value="${pd.receive_id}"/>
	<input type="hidden" name="user_id" id="user_id" value="${pd.user_id}"/>
	<input type="hidden" name="revision_id" id="revision_id" value="${pd.revision_id}"/>
	<input type="hidden" name="status" id="status" value="${pd.receive_status}"/>
	<input type="hidden" name="job_id" id="job_id" value="${pd.job_id}"/>
	<input type="hidden" name="receive_attachment" id="receive_attachment" value="${pd.receive_attachment}"/>
	<input type="hidden" name="receive_name" id="receive_name" value="${pd.receive_name}"/>
	<input type="hidden" name="company_id" id="company_id" value="${pd.company_id}"/>
	<input type="hidden" name="dept_id" id="dept_id" value="${pd.dept_id}"/>
	<input type="hidden" name="receive_type" id="receive_type" value="${pd.receive_type}"/>
		<div id="zhongxin">
		<table id="table_report" class="table table-striped table-bordered table-hover">
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">录入人:</td>
				<td><input readonly type="text" name="receive_person" id="receive_person" value="${pd.receive_person}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">标题:</td>
				<td><input readonly type="text" name="receive_title" id="receive_title" value="${pd.receive_title}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">信息类型:</td>
				<td >
				<input readonly type="text" name="type" id="type" 
				<c:if test="${pd.receive_type == 0}">value="其他"</c:if>
				<c:if test="${pd.receive_type == 1}">value="律师函"</c:if>
				<c:if test="${pd.receive_type == 2}">value="诉讼文件"</c:if>
				maxlength="32" placeholder="这里输入" title=""/>
				</td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">添加时间:</td>
				<td><input readonly type="text" name="receive_time" id="receive_time" value="${pd.receive_time}"     placeholder="录入时间"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">结束时间:</td>
				<td><input readonly type="text" name="receive_endtime" id="receive_endtime" value="${pd.receive_endtime}"    placeholder="录入时间"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">附件:</td>
				<td style="text-align: left;" >
					<a class="btn btn-mini btn-primary" onclick="downloadFile('${pd.receive_id}');">下载合同附件</a>
				</td>
			</tr>
			<c:if test="${pd.receive_status == 0}">
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行人:</td>
				<td>
				<select class="chzn-select" name="revision_person" id="revision_person" style="vertical-align:top;width: 220px;">
					<c:forEach items="${list}" var="var" varStatus="vs">
					<option value="${var.user_id}">${var.name}</option>
					</c:forEach>
				</select>
				</td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行开始时间:</td>
				<td><input  type="text" name="revision_begintime" id="revision_begintime" class="form_datetime" readonly="readonly" placeholder="执行时间"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">是否执行:</td>
				<td>
				<select id="receive_status" name="receive_status">
				<option value="0">不执行</option>
				<option value="1">执行</option>
				</select>
				</td>
			</tr>
			<tr>
				<td style="text-align: center;" colspan="10">
					<a class="btn btn-mini btn-primary" onclick="save();">保存</a>
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
			</c:if>
			<c:if test="${pd.receive_status == 1}">
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行人:</td>
				<td><input readonly  type="text" name="revision_person" id="revision_person" value="${pd.revision_person}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行开始时间:</td>
				<td><input readonly  type="text" name="revision_begintime" id="revision_begintime" value="${pd.revision_begintime}" readonly="readonly"  placeholder="开始时间"/></td>
			</tr>
			<tr>
				<td style="text-align: center;" colspan="10">
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
			</c:if>
			<c:if test="${pd.receive_status == 2}">
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行人:</td>
				<td><input readonly  type="text" name="revision_person" id="revision_person" value="${pd.revision_person}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行开始时间:</td>
				<td><input readonly  type="text" name="revision_begintime" id="revision_begintime" value="${pd.revision_begintime}"  placeholder="录入时间"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行结束时间:</td>
				<td><input readonly  type="text" name="revision_endtime" id="revision_endtime" value="${pd.revision_endtime}"  placeholder="录入时间"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">执行完毕:</td>
				<td>
				<select id="re_status" name="re_status">
				<option value="" selected="selected">
					<c:if test="${pd.receive_status == 1}">执行中</c:if>
					<c:if test="${pd.receive_status == 2}">执行完毕</c:if>
				</option>
				<option value="1">执行中</option>
				<option value="2">执行完毕</option>
				</select>
				</td>
			</tr>
			<tr>
				<td style="text-align: center;" colspan="10">
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
			</c:if>
		</table>
		</div>
		
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
		
	</form>
	
	
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="static/js/bootstrap-datetimepicker.js"></script><!-- 日期框 -->
		<script type="text/javascript">
		$(top.hangge());
		$(function() {
			
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$(".form_datetime").datetimepicker( {
                autoclose:true,
                format: "yyyy-mm-dd hh:ii",
                language: 'cn',
                clearBtn:true,
                todayHighlight: true
            });
			
		});
		
		function downloadFile(Id){
			window.location.href="<%=basePath%>lawreceive/downloadFile.do?receive_id="+Id;
		}
		
		</script>
</body>
</html>